﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SQLite;

namespace Cashier_DAO.db
{
    public class SQLiteConnectionInstance
    {
        private static String dbPath = String.Empty;

        static SQLiteConnectionInstance()
        {
            dbPath = "Data Source=" + System.Windows.Forms.Application.StartupPath + @"\db\cashier.s3db;Pooling=true;";
        }

        /// <summary>
        /// 返回数据连接
        /// </summary>
        /// <returns></returns>
        public static SQLiteConnection GetSQLiteConnection()
        {
            SQLiteConnection conn = null;
            try
            {
                conn = new SQLiteConnection(dbPath);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return conn;
        }
    }
}
